package com.example.demo27.service.impl;

/**
 * @Author zhaox
 * @Date 22/3/23
 */
import com.example.demo27.bean.User;
import com.example.demo27.mapper.UserMapper;
import com.example.demo27.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service("userService")
public class UserServiceImpl implements UserService {
    @Resource
    UserMapper userMapper;


    @Override
    public User getByUserNameAndPassword(User user) {
        User loginUser = userMapper.getByUserNameAndPassword(user);
        return loginUser;
    }

    @Override
    public int save(User user) {
        return userMapper.save(user);
    }

    @Override
    public int updateUser(String username) {
        return userMapper.updateUser(username);
    }
}